# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1497 -> 1.1498 # kernel/sysctl.c 1.52 -> 1.53 # fs/proc/task_mmu.c 1.5 -> 1.6 # include/linux/sysctl.h 1.53 -> 1.54 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/11/26 davidm@tiger.hpl.hp.com 1.1496.1.1 # ia64: Fix a bug in sigtramp() which corrupted ar.rnat when unwinding # across a signal trampoline (in user space). Reported by # Laurent Morichetti. # -------------------------------------------- # 03/11/26 davidm@tiger.hpl.hp.com 1.1498 # Drop KERN_CACHEDECAYTICKS sysctl. # Add KERN_GATE_DSO sysctl, which allows to register a pathname for # the file containing an image of the gate DSO. # -------------------------------------------- # diff -Nru a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c --- a/fs/proc/task_mmu.c Sun Dec 14 00:40:06 2003 +++ b/fs/proc/task_mmu.c Sun Dec 14 00:40:06 2003 @@ -1,6 +1,7 @@ #include #include #include +#include #include char *task_mem(struct mm_struct *mm, char *buffer) @@ -75,6 +76,23 @@ return size; } +#ifdef AT_SYSINFO_EHDR + +char gate_dso_path[256] = ""; +static struct vm_area_struct gate_vmarea = { + /* Do _not_ mark this area as readable, cuz not the entire range may be readable + (e.g., due to execute-only pages or holes) and the tools that read + /proc/PID/maps should read the interesting bits from the gate-DSO file + instead. */ + .vm_start = FIXADDR_USER_START, + .vm_end = FIXADDR_USER_END +}; + +# define gate_map() &gate_vmarea +#else +# define gate_map() NULL +#endif + static int show_map(struct seq_file *m, void *v) { struct vm_area_struct *map = v; @@ -100,12 +118,15 @@ map->vm_pgoff << PAGE_SHIFT, MAJOR(dev), MINOR(dev), ino, &len); - if (map->vm_file) { + if (map->vm_file || map == gate_map()) { len = 25 + sizeof(void*) * 6 - len; if (len < 1) len = 1; seq_printf(m, "%*c", len, ' '); - seq_path(m, file->f_vfsmnt, file->f_dentry, " \t\n\\"); + if (map == gate_map()) + seq_printf (m, "%s", gate_dso_path); + else + seq_path(m, file->f_vfsmnt, file->f_dentry, " \t\n\\"); } seq_putc(m, '\n'); return 0; @@ -128,6 +149,8 @@ if (!map) { up_read(&mm->mmap_sem); mmput(mm); + if (l == -1) + map = gate_map(); } return map; } @@ -135,7 +158,7 @@ static void m_stop(struct seq_file *m, void *v) { struct vm_area_struct *map = v; - if (map) { + if (map && map != gate_map()) { struct mm_struct *mm = map->vm_mm; up_read(&mm->mmap_sem); mmput(mm); @@ -149,6 +172,8 @@ if (map->vm_next) return map->vm_next; m_stop(m, v); + if (map != gate_map()) + return gate_map(); return NULL; } diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h Sun Dec 14 00:40:06 2003 +++ b/include/linux/sysctl.h Sun Dec 14 00:40:06 2003 @@ -127,7 +127,7 @@ KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */ KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */ - KERN_CACHEDECAYTICKS=60,/* ulong: value for cache_decay_ticks (EXPERIMENTAL!) */ + KERN_GATE_DSO=60, /* string: path to gate DSO file */ }; diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c Sun Dec 14 00:40:06 2003 +++ b/kernel/sysctl.c Sun Dec 14 00:40:06 2003 @@ -37,6 +37,7 @@ #include #include #include +#include #include #ifdef CONFIG_ROOT_NFS @@ -65,6 +66,9 @@ static int maxolduid = 65535; static int minolduid; +#ifdef AT_SYSINFO_EHDR +extern char gate_dso_path[]; +#endif #ifdef CONFIG_KMOD extern char modprobe_path[]; #endif @@ -395,6 +399,17 @@ .strategy = &sysctl_string, }, #endif +#ifdef AT_SYSINFO_EHDR + { + .ctl_name = KERN_GATE_DSO, + .procname = "gate_dso", + .data = &gate_dso_path, + .maxlen = 256, + .mode = 0644, + .proc_handler = &proc_dostring, + .strategy = &sysctl_string, + }, +#endif #ifdef CONFIG_CHR_DEV_SG { .ctl_name = KERN_SG_BIG_BUFF, @@ -579,16 +594,6 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, -#ifdef CONFIG_SMP - { - .ctl_name = KERN_CACHEDECAYTICKS, - .procname = "cache_decay_ticks", - .data = &cache_decay_ticks, - .maxlen = sizeof(cache_decay_ticks), - .mode = 0644, - .proc_handler = &proc_doulongvec_minmax, - }, -#endif { .ctl_name = 0 } };